1. Field of the Invention
The present invention relates to a printing apparatus for printing according to data sent from a host device and to a printing system.
2. Description of the Related Art
When a problem occurs in a printer connected to a host device, the printer conventionally run an error recovery process such as outlined below and taught in JP-11-268384.
(1) When the problem occurs, the printer sends a status report to the host and then goes off-line. The status report identifies the cause of the printer going off-line, such as there being no paper or the cover being opened, or the cause of the error, such as a paper jam.
(2) When the host device receives the error status report from the printer, it interrupts data transmission from the application program to the printer, and destroys any unsent data (the data stored in a data buffer managed by the application).
(3) When the printer confirms that the error has been resolved, it sends an error recovery status report to the host device, destroys any unprinted data in the receive buffer and print buffer, and goes back on-line.
(4) When the host device receives the error recovery status report from the printer, it resumes data transmission from the application starting from the beginning of the data that was being sent when the error occurred.
A problem with this error recovery process is that if the printer error is corrected before data transmission by the application stops, that is, if step (3) above is processed before step (2) is completed, data that was being sent and data that was output before data transmission could be interrupted in step (2) is left in the printer.
This is described more specifically with reference to FIG. 14A. Data sent from the host 510 is sent from the application data buffer 511 managed by the application program through the OS transmission buffer 512 managed by the operating system (OS) to the receive buffer 521 of the printer 520 through an interface not shown. If data remains in the OS transmission buffer 512 or the application data buffer 511 when an error occurs on the printer side, the printer prints unwanted (unnecessary) data after the printer 520 problem is corrected because the data stored in buffer 511 or 512 cannot be erased or the interrupt process halting data transmission is not executed in time. This wastes paper or other printing medium and ink, and thus wastes resources.
In a POS system (point-of-sale data management system) used in convenience stores and other retail businesses, data is sent from the host 510 (cash register terminal) through a POS server 530 to the printer 520 (receipt printer) as shown in FIG. 14B, and data accumulated in the data buffer 531 of the POS server 530 can also produce wasted printouts. How to efficiently delete data accumulated in these four buffers 511, 512, 521, and 531 shown in FIG. 14 is therefore a significant problem.
A function for sending a clear buffer request to the OS transmission buffer 512 and data buffer 531 of the POS server 530 to delete buffered data could be provided to solve this problem, but implementing this function is complicated. Applying a hardware reset to the POS server 530 is also possible, but when multiple POS terminals are connected to the POS server 530, for example, resetting the server interrupts processing by all POS terminals, and this method is therefore not practical.